package com.dgut.service.background.service;

import com.dgut.service.background.dao.EnterDao;
import com.dgut.service.background.dao.OutsDao;
import com.dgut.service.background.entity.Enter;
import com.dgut.service.background.entity.Outs;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PassService {
    @Autowired
    private OutsDao outsDao;

    @Autowired
    private EnterDao enterDao;

    public int getEnterData(String date1, String date2){
        List<Enter> enters = enterDao.findAllByTimesBetween(date1, date2);
        int count = enters.size();
        return count;
    }

    public int getOutsData(String date1, String date2){
        List<Outs> outs = outsDao.findAllByTimesBetween(date1, date2);
        int count = outs.size();
        return count;
    }
}
